home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CONNECT4.ZIP / C4.H < prev    next >
C/C++ Source or Header  |  1997-05-17  |  2KB  |  53 lines

  1. /****************************************************************************/
  2. /**                                                                        **/
  3. /**                          Connect-4 Algorithm                           **/
  4. /**                                                                        **/
  5. /**                              Version 3.4                               **/
  6. /**                                                                        **/
  7. /**                            By Keith Pomakis                            **/
  8. /**                          (pomakis@pobox.com)                           **/
  9. /**                                                                        **/
  10. /**                              April, 1997                               **/
  11. /**                                                                        **/
  12. /****************************************************************************/
  13. /**                                                                        **/
  14. /**                  See the file "c4.c" for documentation.                **/
  15. /**                                                                        **/
  16. /****************************************************************************/
  17.  
  18. #ifndef C4_DEFINED
  19. #define C4_DEFINED
  20.  
  21. #include <time.h>
  22.  
  23. #ifndef Boolean
  24. #define Boolean char
  25. #endif
  26.  
  27. #ifndef TRUE
  28. #define TRUE 1
  29. #endif
  30.  
  31. #ifndef FALSE
  32. #define FALSE 0
  33. #endif
  34.  
  35. #define C4_NONE      2
  36. #define C4_MAX_LEVEL 16
  37.  
  38. /* See the file "c4.c" for documentation on the following functions. */
  39.  
  40. extern void    c4_poll(void (*poll_func)(void), clock_t interval);
  41. extern void    c4_new_game(int width, int height, int num);
  42. extern Boolean c4_make_move(int player, int column, int *row);
  43. extern Boolean c4_auto_move(int player, int level, int *column, int *row);
  44. extern char ** c4_board(void);
  45. extern int     c4_score_of_player(int player);
  46. extern Boolean c4_is_winner(int player);
  47. extern Boolean c4_is_tie(void);
  48. extern void    c4_win_coords(int *x1, int *y1, int *x2, int *y2);
  49. extern void    c4_end_game(void);
  50. extern void    c4_reset(void);
  51.  
  52. #endif /* C4_DEFINED */
  53.